From e21b3a393ee99da58409979f082fef6e799249fc Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 17 Mar 2006 11:00:46 +0100 Subject: [PATCH] Fix sched_sedf adjdom to properly clamp the period max value. Remove temporary debug tracing. Signed-off-by: Keir Fraser --- xen/common/sched_sedf.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c index 2fa363ba24..6e216195a8 100644 --- a/xen/common/sched_sedf.c +++ b/xen/common/sched_sedf.c @@ -57,11 +57,9 @@ #define WEIGHT_PERIOD (MILLISECS(100)) #define WEIGHT_SAFETY (MILLISECS(5)) -/* FIXME: need to validate that these are sane */ -#define PERIOD_MAX ULONG_MAX -#define PERIOD_MIN (MICROSECS(10)) -#define SLICE_MAX ULONG_MAX -#define SLICE_MIN (MICROSECS(5)) +#define PERIOD_MAX MILLISECS(10000) /* 10s */ +#define PERIOD_MIN (MICROSECS(10)) /* 10us */ +#define SLICE_MIN (MICROSECS(5)) /* 5us */ #define IMPLY(a, b) (!(a) || (b)) #define EQ(a, b) ((!!(a)) == (!!(b))) @@ -585,11 +583,6 @@ static void update_queues( curinf->deadl_abs += DIV_UP(now - curinf->deadl_abs, curinf->period) * curinf->period; - if (unlikely(curinf->deadl_abs < now)) - printk("Fatal scheduler error: %"PRIu64" %"PRIu64" %"PRIu64 - " diff=%"PRIu64"\n", - curinf->deadl_abs, now, curinf->period, - now - curinf->deadl_abs); ASSERT(curinf->deadl_abs >= now); /*give a fresh slice*/ curinf->cputime = 0; @@ -1622,9 +1615,8 @@ static int sedf_adjdom(struct domain *p, struct sched_adjdom_cmd *cmd) */ if ( (cmd->u.sedf.period > PERIOD_MAX) || (cmd->u.sedf.period < PERIOD_MIN) || - (cmd->u.sedf.slice > SLICE_MAX) || - (cmd->u.sedf.slice < SLICE_MIN) || - (cmd->u.sedf.slice > cmd->u.sedf.period) ) + (cmd->u.sedf.slice > cmd->u.sedf.period) || + (cmd->u.sedf.slice < SLICE_MIN) ) return -EINVAL; EDOM_INFO(v)->weight = 0; EDOM_INFO(v)->extraweight = 0; -- 2.30.2